﻿@model AuditWeb.Models.RegisterModel

@{
    ViewBag.Title = "Register";
}

<h2>创建新用户</h2>
<p>
    密码长度至少 @Membership.MinRequiredPasswordLength 位.
</p>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true, "输入有误.")
    <div>
        <fieldset>
            <legend>用户信息</legend>

            <div class="editor-label">
                @Html.LabelFor(m => m.UserName)
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(m => m.UserName)
                @Html.ValidationMessageFor(m => m.UserName)
            </div>

            <div class="editor-label">
                @Html.LabelFor(m => m.Email)
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(m => m.Email)
                @Html.ValidationMessageFor(m => m.Email)
            </div>

            <div class="editor-label">
                @Html.LabelFor(m => m.Password)
            </div>
            <div class="editor-field">
                @Html.PasswordFor(m => m.Password)
                @Html.ValidationMessageFor(m => m.Password)
            </div>

            <div class="editor-label">
                @Html.LabelFor(m => m.ConfirmPassword)
            </div>
            <div class="editor-field">
                @Html.PasswordFor(m => m.ConfirmPassword)
                @Html.ValidationMessageFor(m => m.ConfirmPassword)
            </div>
            <div class="editor-label">
            @AuditResources.Account.RoleName
        </div>
        <div class="editor-field">
            @foreach (string r in ViewBag.Roles)
            {
                @Html.CheckBox(r, false)@r
            }
            <span  class="field-validation-error">@ViewBag.RolesError</span>
        </div>
            <div class="editor-label">
                @AuditResources.Account.RealName
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(m => m.Profile.RealName)
                @Html.ValidationMessageFor(m => m.Profile.RealName)
            </div>
             <div class="editor-label">
                @AuditResources.Account.County
            </div>
            <div class="editor-field">
                @Html.DropDownListFor(m=>m.Profile.CountyCode,(SelectList)ViewBag.CountyCode, "无",null)
                @Html.ValidationMessageFor(m => m.Profile.CountyCode)
            </div>
            <div class="editor-label">
                @AuditResources.Account.Subject
            </div>
            <div class="editor-field">
                @Html.DropDownListFor(m=>m.Profile.SubjectId,(SelectList)ViewBag.SubjectID)
                @Html.ValidationMessageFor(m => m.Profile.SubjectId)
            </div>
            <div class="editor-label">
                @AuditResources.Account.Telephone
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(m => m.Profile.Telephone)
                @Html.ValidationMessageFor(m => m.Profile.Telephone)
            </div>
            <p>
                <input type="submit" value="@AuditResources.UI.Save" />
            </p>
        </fieldset>
    </div>
}
